﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using FSS.Core.Controls;
using Ext.Net;
using FSS.BLL.Entities;
using FSS.BLL.Services;
using FSS.Core.Util;
using log4net;

namespace FSS.Module.List
{
    public partial class ScreenList : BasePage, IBaseListPage
    {
        private static readonly ILog log = LogManager.GetLogger(typeof(ScreenList));
        public ScreenList()
            : base(SCREENS.SCREEN)
        {

        }
        protected void Page_Load(object sender, EventArgs e)
        {
            base.CheckPermissionControl();
        }

        [DirectMethod]
        public void DocumentReady()
        {
            BindingGrid();
        }
        private void BindingGrid()
        {
            ScreenEntity screenE = new ScreenEntity();
            ScreenService screenS = ScreenService.GetInstance();
            List<ScreenEntity> lstScreen = (List<ScreenEntity>)screenS.LoadAll();
            if (null != lstScreen)
            {
                storeMain.DataSource = lstScreen;
                storeMain.DataBind();
            }
        }
        protected void grdMain_OnCommand(object sender, DirectEventArgs e)
        {
            string id = e.ExtraParams["id"];
            string command = e.ExtraParams["command"];
            if (IsEdit && Constants.Edit.Equals(command))
            {
                //this.WindowEditor.Show();
            }
            else if (IsDelete && Constants.Delete.Equals(command))
            {
                //this.WindowEditor.Show();
            }

        }


        public void btnAdd_Click(object sender, DirectEventArgs e) { }
        public void btnEdit_Click(object sender, DirectEventArgs e) { }
        public void btnDelete_Click(object sender, DirectEventArgs e) { }
        public void btnPrint_Click(object sender, DirectEventArgs e) { }
        public void btnImport_Click(object sender, DirectEventArgs e) { }
        public void btnExport_Click(object sender, DirectEventArgs e) { }
        public void btnFind_Click(object sender, DirectEventArgs e) { }

    }
}
